package com.ruoyi.mysystem.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.mysystem.domain.SysCollectionList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mysystem.mapper.SysCollectionMapper;
import com.ruoyi.mysystem.domain.SysCollection;
import com.ruoyi.mysystem.service.ISysCollectionService;

/**
 * 收藏管理Service业务层处理
 * 
 * @author bai
 * @date 2024-02-06
 */
@Service
public class SysCollectionServiceImpl implements ISysCollectionService 
{
    @Autowired
    private SysCollectionMapper sysCollectionMapper;

    /**
     * 查询收藏管理
     * 
     * @param userId 收藏管理主键
     * @return 收藏管理
     */
    @Override
    public SysCollection selectSysCollectionByUserId(Long userId)
    {
        return sysCollectionMapper.selectSysCollectionByUserId(userId);
    }

    /**
     * 查询收藏管理列表
     * 
     * @param sysCollection 收藏管理
     * @return 收藏管理
     */
    @Override
    public List<SysCollection> selectSysCollectionList(SysCollection sysCollection)
    {
        return sysCollectionMapper.selectSysCollectionList(sysCollection);
    }

    /**
     * 新增收藏管理
     * 
     * @param sysCollection 收藏管理
     * @return 结果
     */
    @Override
    public int insertSysCollection(SysCollection sysCollection)
    {
        sysCollection.setCreateTime(DateUtils.getNowDate());
        return sysCollectionMapper.insertSysCollection(sysCollection);
    }

    /**
     * 修改收藏管理
     * 
     * @param sysCollection 收藏管理
     * @return 结果
     */
    @Override
    public int updateSysCollection(SysCollection sysCollection)
    {
        sysCollection.setUpdateTime(DateUtils.getNowDate());
        return sysCollectionMapper.updateSysCollection(sysCollection);
    }

    /**
     * 批量删除收藏管理
     * 
     * @param userIds 需要删除的收藏管理主键
     * @return 结果
     */
    @Override
    public int deleteSysCollectionByUserIds(Long[] userIds)
    {
        return sysCollectionMapper.deleteSysCollectionByUserIds(userIds);
    }

    /**
     * 删除收藏管理信息
     * 
     * @param userId 收藏管理主键
     * @return 结果
     */
    @Override
    public int deleteSysCollectionByUserId(Long userId)
    {
        return sysCollectionMapper.deleteSysCollectionByUserId(userId);
    }

    @Override
    public int cancelCollection(SysCollection cancelCollection) {
        return sysCollectionMapper.cancelCollection(cancelCollection);
    }

    @Override
    public int cancelCollectionList(SysCollectionList sysCollectionList) {
        return sysCollectionMapper.cancelCollectionList(sysCollectionList);
    }
}
